package com.xuyoupeng.springlearn.bean.dao;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xuyoupneg
 * @description TODO
 * @date 2024/3/18 19:53
 */
public class UserDao {

    private static Map<String, String> userMap = new HashMap<>();

    public void initDataMethod() {
        System.out.println("执行初始化方法");
        userMap.put("101", "高木");
        userMap.put("102", "西片");
        userMap.put("103", "小千");
    }

    public void destroyDataMethod() {
        System.out.println("执行销毁方法");
        userMap.clear();
    }

    public String queryUserName(String userId) {
        return userMap.get(userId);
    }

    public String queryUserInfo(String userId) {
        return userMap.get(userId);
    }
}
